<?php

namespace App\Models\Recommend;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Reclist0
 * @package App\Models\Recommend
 * @version July 31, 2018, 10:01 am CST
 *
 * @property \App\Models\Recommend\Reccat reccat
 * @property \App\Models\Recommend\Paneltpl paneltpl
 * @property string name
 * @property string title
 * @property string subtitle
 * @property integer reccat_id
 * @property integer type_id
 * @property integer range
 * @property integer tpl_id
 * @property string bulk
 * @property integer count
 */
class Reclist0 extends Model
{
    use SoftDeletes;


    public $table = 'reclist0s';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'name',
        'title',
        'subtitle',
        'reccat_id',
        'type_id',
        'range',
        'tpl_id',
        'bulk',
        'count'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'name' => 'string',
        'title' => 'string',
        'subtitle' => 'string',
        'reccat_id' => 'integer',
        'type_id' => 'integer',
        'range' => 'integer',
        'tpl_id' => 'integer',
        'bulk' => 'string',
        'count' => 'integer'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     **/
    public function reccat()
    {
        return $this->hasOne(\App\Models\Recommend\Reccat::class, 'id', 'reccat_id');
    }


     /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     * 页面推荐位位数据
     **/
    public function reclist0Data()
    {
        return $this->hasMany(\App\Models\Recommend\Reclist0Data::class, 'reclist0_id', 'id');
    }
}
